<?php include PATH_TPL."/tpl_header.html" ?>
<script type="text/javascript">
	$(function(){
		$("#course-menu").addClass('in');
	})
</script>

<div class="header">
    <h1 class="page-title">成绩管理</h1>
</div>
        
<ul class="breadcrumb">
    <li><a>成绩管理</a> <span class="divider">/</span></li>
    <li><a href="<?php echo SITE_ROOT?>teacher/show-all-courses">所有课程</a> <span class="divider">/</span></li>
    <li class="active">录入<?php echo $course['coursename']?>的期末成绩(<?php echo $term[$course['term']]?>)</li>
</ul>

<div class="container-fluid">
    <div class="row-fluid">
		<div class="btn-toolbar">
		   	<span class="btn primary-btn" onclick="history.go(-1);"><<返回</span>
		</div>
		<div class="well">
			<form method="post" action="<?php echo SITE_ROOT?>teacher/saveGrades">
			<input type="hidden" value="<?php echo $course['course_id'] ?>" id="course_id" name="course_id">
		    <table class="table">
		    	<?php if (!empty($allGrades)) {?>
		      <thead>
		        <tr>
		          <th>学号</th>
		          <th>姓名</th>
		          <th>成绩</th>
		        </tr>
		      </thead>
		      <tbody>
		      	<?php foreach ($allGrades as $k => $grade) { ?>
		        <tr>
			          <td><?php echo $grade['student_id'] ?></td>
			          <td>
			          	  <?php echo $allStudent[$grade['student_id']]['name']?>
			          </td>
			          <td><input type="text" name="uid[<?php echo $grade['student_id']?>]"  value="<?php if($grade['score']) echo $grade['score']?>" />
			          </td>
		        </tr>
		        <?php }?>
		        <tr>
			        	<td colspan="3">
			        	<div class="btn-toolbar pull-right">
						    <input type="submit" name="submit" class="btn btn-primary" value="保存">
						</div>
						</td>
				</tr>
		      </tbody>
		      <?php }else{?>
		      <tr><td>暂无信息</td></tr>
		      <?php }?>
		    </table>
		    </form>
		</div>
		<a href="#" style="float: right; line-height: 1.25em; display: inline-block; padding: .75em 0em;"><i class="icon-circle-arrow-up"></i> Top</a>
	</div>
</div>
<?php include PATH_TPL."/tpl_sidebar.html" ?>